package com.lyq.controller;

import com.lyq.mapper.DepartmentMapper;
import com.lyq.pojo.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lyq
 * @since 2020-05-19
 */
@RestController
@RequestMapping("/weixing/department")
public class DepartmentController {
    @Autowired
    private DepartmentMapper departmentMapper;
    @RequestMapping("/selectdepartment")
    public List<Department> selectAll(){
        List<Department> departmentList = departmentMapper.selectList(null);
            return departmentList;
    }
    @RequestMapping("/selectdepartmentById")
    public Department selectdepartmentById(int id){

        Department department = departmentMapper.selectById(id);
        return department;
    }
}

